﻿namespace Sidvall.Data
{
    public class ValidationSettings
    {
        #region Public Members

        public bool IncludeNotBrokenRules { get; set; }
        public bool IncludeChildren { get; set; }
        public bool IncludeParents { get; set; }
        #region Parameters

        private System.Lazy<ParameterCollection> _Parameters = new System.Lazy<ParameterCollection>();
        public ParameterCollection Parameters
        {
            get
            {
                return _Parameters.Value;
            }
        }

        #endregion

        #region FullValidation

        public static ValidationSettings FullValidation()
        {
            return FullValidation(true);
        }
        public static ValidationSettings FullValidation(bool includeNotBrokenRules)
        {
            return new ValidationSettings(includeNotBrokenRules, true, true);
        }

        #endregion
        #region ItemValidation

        public static ValidationSettings ItemValidation()
        {
            return ItemValidation(true);
        }
        public static ValidationSettings ItemValidation(bool includeNotBrokenRules)
        {
            return new ValidationSettings(includeNotBrokenRules, false, false);
        }

        #endregion

        #endregion
        #region Constructors

        public ValidationSettings() : this(true, true, true)
        {
        }
        public ValidationSettings(bool includeNotBrokenRules, bool includeChildren, bool includeParents)
        {
            this.IncludeNotBrokenRules = includeNotBrokenRules;
            this.IncludeChildren = includeChildren;
            this.IncludeParents = includeParents;
        }

        #endregion
    }
}
